package com.jgp.glmeeting.controller;

import com.jgp.glmeeting.model.Inform;
import com.jgp.glmeeting.model.Meeting;
import com.jgp.glmeeting.service.InformService;
import com.jgp.glmeeting.service.MeetingService;
import com.jgp.sys.common.controller.JGPController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;

@Controller
@RequestMapping("/glMeeting/informController")
public class InformController extends JGPController {
    @Autowired
    private InformService informService;

    @Autowired
    private MeetingService meetingService;

    //跳转到listInform
    @RequestMapping("/listInform")
    private String listInform(){
        return page("listInform");
    }

    //新建通知跳转到addInform
    @RequestMapping("/addInform")
    private String addInform(){
        return page("addInform");
    }

    //    //改是...先查询在改
    @RequestMapping("/editInform/{id}")
    public String editInform(@PathVariable String id, Model model){
        Inform i=informService.queryInformID(id);
        Meeting m=meetingService.queryID(i.getMeetingID());
        model.addAttribute("meetingName",m.getName());
        re(model,"editInform",i);
        return page("editInform");
    }


}
